<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>HTML 中使用class</title>
    <style>
        .cities{
            background-color: black;
            color: white;
            margin: 20px;
            padding: 20px;
        }

        span.red {
            color: red;
        }
    </style>
</head>
<body>
    <div class="cities">
        <h2>London</h2>
        <p>
            London is the capital city of England.
            It is the most populous city in the United Kingdom,
            with a metropolitan area of over 13 million inhabitants.
        </p>
    </div>
    <div class="cities">
        <h2>Paris</h2>
        <p>Paris is the capital and most populous city of France.</p>
    </div>

    <div class="cities">
        <h2>Tokyo</h2>
        <p>Tokyo is the capital of Japan, the center of the Greater Tokyo Area,
            and the most populous metropolitan area in the world.</p>
    </div>

    <!-- span 是行内元素,能够用作文本的容器 -->
    <!-- 设置 span 元素的类 能够为相同的 span 元素设置相同的样式 -->
    <h1>
        My<span class="red">Important</span> Heading
    </h1>
</body>
</html>




























